package com.siyoumi.app.modules.app_ess.web;

import com.siyoumi.app.entity.EssUser;
import com.siyoumi.app.entity.SysUser;
import com.siyoumi.app.modules.app_ess.service.SvcEssUser;
import com.siyoumi.app.modules.user.service.SvcSysUser;
import com.siyoumi.component.XBean;
import com.siyoumi.controller.WxAppApiController;
import com.siyoumi.util.XReturn;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@Slf4j
@RestController
@RequestMapping("/wxapp/app_ess/api")
public class ApiAppEss
        extends WxAppApiController {

    /**
     * 初始化
     *
     * @return
     */
    public XReturn init() {
        EssUser entityUser = SvcEssUser.getApp().loadEntity(getUid());
        Map<String, Object> mapUser = XBean.toMap(entityUser, new String[]{
                "euser_id",
                "euser_type",
                "euser_sex",
                "euser_speciality",
                "euser_school_date",
                "euser_address",
        });
        getR().put("user", mapUser);

        return getR();
    }

    //模块列表
    public XReturn moduleList() {
        return getR();
    }

    //资源列表
    public XReturn fileList() {
        return getR();
    }


}
